home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / misc / avmNfax1_33.lha / avmsuite / deletevoicefiles.rexx < prev    next >
OS/2 REXX Batch file  |  1994-04-18  |  2KB  |  65 lines

  1. /* scan old and new filenames.cfg and find diffs */
  2.  
  3. say "Hello!  This is part of the avm-install script"
  4. say "I am now checking to see if any of the ARexx scripts"
  5. say "require you to re-record your voice files.  I do this"
  6. say "by comparing the old filenames.cfg with the new"
  7. say "filenames.cfg"
  8.  
  9. say
  10.  
  11. say "Hold on while I check stuff.  Don't worry, you will"
  12. say "be asked before any deletions are made!"
  13.  
  14. say
  15.  
  16. opened = open('new', 'avm:filenames.cfg', 'r')
  17. if opened ~= 1 then exit
  18. opened = open('old', 'avm:old/filenames.cfg', 'r')
  19. if opened ~= 1 then exit
  20.  
  21. do while ~eof('new')
  22.   line = readln('new')
  23.   parse upper var line variable '=' value
  24.   if variable = 'FILENAME' then filename = value
  25.   if variable = 'COMMENT' then comment = value
  26.   if variable = 'ENDRECORD' then do
  27.     new.filename = comment
  28.   end
  29. end
  30.  
  31. do while ~eof('old')
  32.   line = readln('old')
  33.   parse upper var line variable '=' value
  34.   if variable = 'FILENAME' then filename = value
  35.   if variable = 'COMMENT' then comment = value
  36.   if variable = 'ENDRECORD' then do
  37.     if new.filename ~= comment then do
  38.       if symbol('new.filename') = 'LIT' then do
  39.         say 'The file' filename 'is not in the new filenames.cfg.'
  40.         say 'Either you have the Programmer and have added a new'
  41.         say 'voice file or this is an old file that is no longer'
  42.         say 'used.'
  43.       end; else if new.filename ~= comment then do
  44.         say 'The file' filename 'has a new comment'
  45.         say 'Old comment:' comment
  46.         say 'New comment:' new.filename
  47.       end
  48.  
  49.       say 'Should I go ahead and delete the file? (y|n)'
  50.       parse upper pull answer
  51.       if answer = 'Y' | answer = 'YES' then
  52.         address command 'delete' filename
  53.       say
  54.     end
  55.   end
  56. end
  57.  
  58. say "You should run the Player program right after"
  59. say "the installation!"
  60.  
  61. say
  62.  
  63. say "Hit <return>"
  64. parse pull answer
  65.